// menu-management 菜单管理

import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import mongoose, { Document, Types } from 'mongoose';

export type MenuDocument = Menu & Document;

@Schema({
  timestamps: {
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
  },
})
export class Menu extends Document {
  // 节点类型
  @Prop({
    type: String,
  })
  nodetype: string;

  // 业务端
  @Prop({
    type: String,
  })
  business: string;

  // 节点名称
  @Prop({
    type: String,
  })
  name: string;

  // 权限标识
  @Prop({
    type: String,
  })
  permission: string;

  // 节点说明
  @Prop({
    type: String,
  })
  description: string;

  // 节点路由
  @Prop({
    type: String,
  })
  route: string;

  // 上级节点 标识
  @Prop({
    type: String,
  })
  parent: string;
}
export const MenuSchema = SchemaFactory.createForClass(Menu);
